function openTab(evt, tabName) {
    // 获取所有选项卡内容并隐藏它们
    const tabContents = document.getElementsByClassName("tab-content");
    for (let i = 0; i < tabContents.length; i++) {
        tabContents[i].classList.remove("active");
    }

    // 获取所有选项卡按钮并移除激活状态
    const tabButtons = document.getElementsByClassName("tab-button");
    for (let i = 0; i < tabButtons.length; i++) {
        tabButtons[i].classList.remove("active");
    }

    // 显示当前选中的选项卡内容并激活相应的按钮
    document.getElementById(tabName).classList.add("active");
    evt.currentTarget.classList.add("active");
}

// 初始化时显示第一个选项卡
document.addEventListener("DOMContentLoaded", function() {
    document.getElementById("Tab1").classList.add("active");
    document.querySelector(".tab-button").classList.add("active");
});